<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>

		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#btn-export').click(function(){	
				if(confirm('ダウンロードしますか？')){
					document.form1.csv.value="download";
					document.form1.submit();
				}
			});
			
			$('#btn-reset').click(function(){	
				location.href = document.form1.action;
			});
			
			$('#btn_search').click(function(){	
				document.form1.csv.value="";
				document.form1.submit();
			});
		});
		function toPage(thepage) {
			document.form1.page.value =  thepage;
			document.form1.csv.value="";
			document.form1.submit();
		}
		</script>
		
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">
{{$menu}}
{{$logout}}
		<div id="container"><div class="wrapper">
			<h2>ログインマスター管理</h2>
			<ul class="submenu clearfix">
				<li>ユーザー情報一覧</li>
				<li><a href="user_form.php">ユーザー情報登録</a></li>
				<li><a href="user_import.php">CSV更新</a></li>
			</ul>
			<h3>ユーザー情報一覧</h3>
			<form name="form1" id="form1" method="get" action="user_index.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody>
						<tr>
							<th>権限</th>
							<td>
{{ html_options name='auth' options=$auth selected=$forms.auth }}{{ $err.auth }}
							</td>
						</tr>
						<tr>
							<th>ユーザー名</th>
							<td>
								<input type="text" name="user_name" value="{{ $forms.user_name }}" class="text" />
							</td>
						</tr><tr>
							<th>更新日</th>
							<td>
								<input type="text" name="upd_f" class="text_date" value="{{ $forms.upd_f }}" /> ～ 
								<input type="text" name="upd_t" class="text_date" value="{{ $forms.upd_t }}" />
							</td>
						</tr>
					</tbody>
				</table>
				<p class="button" style="text-align:right">
					<button type="button" id="btn-reset"><span>クリア</span></button>
					<button type="button" id="btn_search" class="submit"><span>絞込検索</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
{{ if is_numeric($page.cnt) }}

{{ if $page.cnt > 0 }}
			<p class="message">{{ $page.cnt }}件の情報が見つかりました。</p>
			<p align="left">{{$pageing}}</p>
			<table id="search_result" class="sortable">
				<thead>
					<tr>
						<th><h3>ID</h3></th>
						<th sytle="width:38px"><h3>状態</h3></th>
						<th><h3>ユーザー名</h3></th>
						<th><h3>権限</h3></th>
						<th><h3>折込会社/h3></th>
						<th><h3>メールアドレス</h3></th>
						<th><h3>備考</h3></th>
						<th><h3>更新日時</h3></th>
						<th><h3>更新者</h3></th>
						<th><h3>操作</h3></th>
					</tr>
				</thead>
				<tbody>
{{ foreach from=$data key=k item=v name="member" }}
					<tr class="{{cycle values=odd,mod name='member'}}">
						<td>{{ $v.login_id }}</td>
						<td class="center" sytle="width:38px">
{{ if $v.login_ng=='1' }}
							<img src="assets/images/batu.png" > 
{{ else }}
							&nbsp;
{{ /if }}
						</td>
						<td>{{ $v.user_name }}</td>
						<td>{{ $auth[$v.auth] }}</td>
						<td>
							{{ $ins_co[$v.ins_co_cd] }}
						</td>
						<td><a href="mailto:{{ $v.email }}">{{ $v.email }}</a></td>
						<td>{{ $v.memo }}</td>
						<td class="center">{{ $v.u_time|date_format:"%Y/%m/%d %H:%M" }}</td>
						<td >{{ $v.m_user_name }}</td>
						<td class="center"><a href="user_form.php?id={{ $v.id }}">[更新]</a></td>
					</tr>
{{ /foreach }}
				</tbody>
			</table>
			<p align="right">{{$pageing}}</p>
				<p class="button">
					<button type="button" id="btn-export"  ><span>CSVダウンロード</span></button>
				</p>
{{ else }}
<p class="message">条件にマッチする情報は見つかりませんでした。</p>
{{ /if }}
{{ else }}
	<p class="message">ここに検索結果が表示されます。</p>
{{ /if }}
		</div></div>
		{{ $footer }}
	</body>
</html>